const path = require('path')

module.exports = {
  //入口文件 
  entry: path.join(__dirname, 'src/index.js'),
  //出口文件
  output: {
    filename: 'bundle.js',
    path: path.join(__dirname, 'dist')
  },
  //定义用什么加载器加载相应文件
  module: {

    rules: [
      //vue结尾的文件用vueloader加载
      {
        test: /.vue$/,
        loader: 'vue-loader'

      }, {
        test: /\.css$/,
        use: [
          'style-loader', 'css-loader'
        ]
      }, {

        test: /\.styl/,
        use: ['style-loader',
          'css-loader',
          'stylus-loader'
        ]


      }, {
        test: /\.(gif|jpg|jpeg|png|svg)$/,
        use: [
          {
            loader: 'url-loader',
            options: {
              limit: 1024,
              name: '[name]-aaa.[ext]'

            }

          }

        ]

      }]
  }
}